<?php

namespace Admin\Model;
use Think\Model;


class DistrictModel extends Model{
	

	 /**
      * 合并两个二维数组，将省市县的名称加进来
      *
	  *
      */
	public function mergeArray($list){
		foreach ($list as $key=>$val){
			$provinceId = $val['provinceid'];
			$cityId     = $val['cityid'];
			$areaId     = $val['areaid'];
			$provinceName = $this->where('id='.$provinceId)->field('name')->find();
			$cityName=$this->where('id='.$cityId)->field('name')->find();
			$areaName=$this->where('id='.$areaId)->field('name')->find();
			$district['district'] = $provinceName['name'].$cityName['name'].$areaName['name'];
			$lists[]=$val+$district;
		}		
		return $lists;
	} 
}